package com.nursinghome;

import com.nursinghome.bean.Elderly;
import com.nursinghome.bean.MedicalStaff;
import com.nursinghome.admin.mapper.ElderlyMapper;
import com.nursinghome.user.mapper.ElderlyUserMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;
import java.util.Date;

@SpringBootTest
public class MyTest01 {
    @Autowired
    private ElderlyMapper elderlyMapper;
    @Autowired
    private ElderlyUserMapper elderMapper;
    @Test
    public void test01() {
        Elderly elderly = new Elderly(
                null,
                "王五",
                "00003",
                "123123",
                "男",
                new Date(),
                new Date(),
                "371228195911010003",
                "110",
                "111.jpg",

                1,"13791360866",
                1,
                new ArrayList<MedicalStaff>(),
                null);;
        System.out.println(elderlyMapper.addElderly(elderly));
    }
    @Test
    public void test02(){
        Elderly elderly = new Elderly(
                1L,
                "李四",
                "00001",
                "123123",
                "男",
                new Date(),
                new Date(),
                "371228195911010001",
                "110",
                "111.jpg",
                1,
                "13791360866",
                1,
                new ArrayList<MedicalStaff>(),
                null);;
        System.out.println(elderlyMapper.update(elderly));
    }
    @Test
    public void test03(){
        elderlyMapper.selectAll("", "")
                .forEach(System.out::println);
    }
    @Test
    public void test04(){
        System.out.println(elderMapper.selectByeusername("10001"));
    }

}
